﻿using System;

namespace Entities
{
    [Serializable]
    public class Station
    {
        private int stationID;
        private string stastionName;
        public Station()
        { }
        public Station(int stationID, string stastionName)
        {
            this.stationID = stationID;
            this.stastionName = stastionName;
        }
        public int StationID
        {
            get { return this.stationID; }
            set
            {
                if (value < 0)
                    throw new Exception("stationID not allow nullvalue.");
                this.stationID = value;
            }
        }
        public string StastionName
        {
            get { return this.stastionName; }
            set { this.stastionName = value; }
        }
        public override string ToString()
        {
            return this.stationID + "; " + this.stastionName + "; ";
        }
        public override bool Equals(Object obj)
        {
            Station me = (Station)obj;
            bool ret = this.StationID.Equals(me.StationID);
            return ret;
        }
        public override int GetHashCode()
        {
            return this.StationID.GetHashCode();
        }

    }
}